package me.myqaq.myqaqcraft.slimefunaddon.tow;

import me.myqaq.myqaqcraft.slimefunaddon.MyQaqCraft;
import me.myqaq.myqaqcraft.slimefunaddon.utils.CU;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerQuitEvent;

import java.net.http.WebSocket;

public class PlauerQuit implements WebSocket.Listener {
    @EventHandler
    public boolean onPlayerQuit(PlayerQuitEvent event){
        Player player =event.getPlayer();
        FileConfiguration config = MyQaqCraft.getInstance().getConfig();
        event.setQuitMessage(CU.t(config.getString("quit-message")+player.getName()));
        return true;
    }
}
